Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing cells in right and center alignment mode #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alex-ozdemir
Copy link
Contributor

Previously, a cell was a block of text to the left of some tab.

This meant that a table like this:

aa\tbb
a\tb

would be formatted as

aa bb
 a b

in right-alignment mode because the b's were not actually in a cell, and
thus didn't get aligned.

This commit modifies the notion of a "cell" in right- and
center-alignment mode to also include text to the right of the last tab
on the line.

This text is now considered part of a cell and aligned accordingly.

Implemented as describe above, this change would cause many trailing
spaces to be printed in right- and center-alignment modes, including on
empty lines.

To alleviate this, trailing spaces in the final cell of a line are not
printed.

fixes #29

Previously, a **cell** was a block of text to the left of some tab.

This meant that a table like this:

   aa\tbb
   a\tb

would be formatted as

   aa bb
    a b

in right-alignment mode because the b's were not actually in a cell, and
thus didn't get aligned.

This commit modifies the notion of a "cell" in right- and
center-alignment mode to also include text to the right of the last tab
on the line.

This text is now considered part of a cell and aligned accordingly.

Implemented as describe above, this change would cause many trailing
spaces to be printed in right- and center-alignment modes, including on
empty lines.

To alleviate this, trailing spaces in the final cell of a line are not
printed.

fixes BurntSushi#29
@alex-ozdemir alex-ozdemir changed the title a trailing-cell in right and center alignment mode Trailing cells in right and center alignment mode Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Right alignment of last column
1 participant